package com.entrogy.dao;

import com.entrogy.bean.StudentTemperatureInfoEntity;
import com.entrogy.bean.TeacherTemperatureInfoEntity;
import com.entrogy.bean.TemperatureAnalysisEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * @ClassName TemperatureAnalysisMapper
 * @Description
 * @Author luoxingjiang
 * @Date 2020-02-28 上午 10:50
 * @Version 1.0
 **/
@Repository
public interface TemperatureAnalysisMapper {

    /**
     * 查看学校的教师体温统计概览
     * @param schoolCode
     * @param selectDate
     * @param normalTemperate
     * @return
     */
    TemperatureAnalysisEntity getSchoolTeacherTemperatureInfoOverview(@Param("schoolCode") Integer schoolCode, @Param("selectDate") Date selectDate, @Param("normalTemperate") Double normalTemperate);

//    /**
//     * 查看学生体温统计概览
//     * @param schoolCode
//     * @param selectDate
//     * @param normalTemperate
//     * @return
//     */
//    List<TemperatureAnalysisEntity> getSchoolStudentTemperatureInfoOverview(@Param("schoolCode") Integer schoolCode, @Param("selectDate") Date selectDate, @Param("normalTemperate") Double normalTemperate);

    /**
     * 查询年级的体温统计概览
     * @param startTime
     * @param endTime
     * @param schoolCode
     * @param gradeId
     * @param normalTemperate
     * @return
     */
    TemperatureAnalysisEntity getGradeStudentTemperatureInfoOverview(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("schoolCode") Integer schoolCode, @Param("gradeId") Integer gradeId, @Param("normalTemperate") Double normalTemperate);


    /**
     * 查询班级的体温统计概览
     * @param startTime
     * @param endTime
     * @param schoolCode
     * @param classId
     * @param normalTemperate
     * @return
     */
    TemperatureAnalysisEntity getClassStudentTemperatureInfoOverview(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("schoolCode") Integer schoolCode, @Param("classId") Integer classId, @Param("normalTemperate") Double normalTemperate);

    /**
     * 查询学生体温数据
     * @param schoolCode
     * @param normalTemperature
     * @param normalFlag
     * @param startTime
     * @param endTime
     * @param gradeId
     * @param classId
     * @return
     */
    List<StudentTemperatureInfoEntity> listStudentTemp(@Param("schoolCode") Integer schoolCode, @Param("normalTemperature") Double normalTemperature, @Param("normalFlag") boolean normalFlag, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("gradeId") Integer gradeId, @Param("classId") Integer classId);


    /**
     * 查询教师体温数据
     * @param schoolCode
     * @param normalTemperature
     * @param normalFlag
     * @param startTime
     * @param endTime
     * @return
     */
    List<TeacherTemperatureInfoEntity> listTeacherTemp(@Param("schoolCode") Integer schoolCode, @Param("normalTemperature") Double normalTemperature, @Param("normalFlag") boolean normalFlag, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    /**
     * 家长查询自己孩子们的体温数据
     * @param parentId
     * @param startTime
     * @param endTime
     * @param studentId
     * @return
     */
    List<StudentTemperatureInfoEntity> listChildTempInfo(@Param("parentId") String parentId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("studentId") Integer studentId);

}
